home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Nave / LunarLander.swf / scripts / frame_4 / PlaceObject2_37_5 / CLIPACTIONRECORD onClipEvent(enterFrame).as next >
Encoding:
Text File  |  2006-06-13  |  1.0 KB  |  25 lines

  1. onClipEvent(enterFrame){
  2.    hit = this.hitTest(_root.lander.ship);
  3.    if(hit && _root.lander.vel - 20 >= 0 && 2 >= _root.lander.vel - 20 && 8 >= Math.abs(_root.lander._rotation))
  4.    {
  5.       _root.lander.landed = true;
  6.       if(score)
  7.       {
  8.          _root.padscore = 200;
  9.          _root.bonus = val1;
  10.          _root.rotscore = Math.round((8 - Math.abs(_root.lander._rotation)) * 25,0);
  11.          _root.velscore = Math.round((2 - (_root.lander.vel - 20)) * 100,0);
  12.          _root.lander.score += _root.lander.fuel + _root.padscore + _root.bonus + _root.rotscore + _root.velscore;
  13.          _root.fuelscore = _root.lander.fuel;
  14.          _root.gravscore = Math.round(_root.grav * 20,0);
  15.          _root.fuelgravscore = _root.fuelscore * _root.gravscore + _root.fuelgravscore;
  16.          trace("padscore=" + _root.padscore + ", bonus=" + _root.bonus + ", rotscore=" + _root.rotscore + ", velscore=" + _root.velscore);
  17.          score = false;
  18.       }
  19.    }
  20.    else if(hit)
  21.    {
  22.       _root.lander.dead = true;
  23.    }
  24. }
  25.